<template>
  <div class="rwview-section">
    <el-row>
      <el-col :span="20">
        <p class="pinformation">技术评审</p>
      </el-col>
      <el-col :span="2">
        <el-button link size="small" style="line-height: 24px"
          >导出合同评审单</el-button
        >
      </el-col>
      <el-col :span="2">
        <el-button
          type="success"
          size="small"
          style="margin-bottom: 5px"
          @click="handeleSave"
          >保存</el-button
        >
      </el-col>
    </el-row>
    <el-form :model="form" ref="formRef">
      <el-row>
        <el-col :span="9">
          <el-form-item
            label="委托要求是否明确："
            label-width="340px"
            prop="isWt"
          >
            <el-radio-group v-model="form.isWt">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="2">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="15">
          <el-form-item label="详细说明：" prop="wtContent">
            <el-input clearable v-model="form.wtContent"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="9">
          <el-form-item
            label="本公司技术、能力资源是否满足委托方要求："
            label-width="340px"
            prop="isWtf"
          >
            <el-radio-group v-model="form.isWtf">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="2">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="15">
          <el-form-item label="详细说明：" prop="wtfContent">
            <el-input clearable v-model="form.wtfContent"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="9">
          <el-form-item
            label="检测方法、资质是否满足委托方要求："
            label-width="340px"
            prop="isJfyq"
          >
            <el-radio-group v-model="form.isJfyq">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="2">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="15">
          <el-form-item label="详细说明：" prop="jfyqContent">
            <el-input clearable v-model="form.jfyqContent"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="9">
          <el-form-item
            label="是否需要分包："
            label-width="340px"
            prop="isPackage"
          >
            <el-radio-group v-model="form.isPackage">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="2">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="15">
          <el-form-item
            label="委托方是否认可："
            label-width="120px"
            prop="isAccept"
          >
            <el-radio-group v-model="form.isAccept">
              <el-radio :label="1">认可</el-radio>
              <el-radio :label="2">不认可</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="9">
          <el-form-item
            label="在现有检测工作量的前提下能否按时提供报告："
            label-width="340px"
            prop="isReport"
          >
            <el-radio-group v-model="form.isReport">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="2">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="15">
          <el-row>
            <el-col :span="12">
              <el-form-item
                label="确定检测时间："
                label-width="120px"
                prop="testDate"
              >
                <el-date-picker
                  v-model="form.testDate"
                  type="date"
                  value-format="YYYY-MM-DD"
                  placeholder="请选择"
                />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item
                label="计划完成时间："
                label-width="120px"
                prop="finishDate"
              >
                <el-date-picker
                  type="date"
                  value-format="YYYY-MM-DD"
                  placeholder="请选择"
                  v-model="form.finishDate"
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
      </el-row>
      <el-form-item label="其他：" prop="other">
        <el-input clearable v-model="form.other"></el-input>
      </el-form-item>

      <el-row>
        <el-col :span="8">
          <el-form-item
            label="评审人（技术负责人）："
            label-width="300px"
            prop="zanding"
          >
            <el-input clearable v-model="form.zanding"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="4">
          <el-form-item label="日期：" label-width="80px" prop="zanding">
            <el-date-picker
              v-model="form.zanding"
              placeholder="请选择日期"
              style="width: 97%"
              type="date"
              value-format="YYYY-MM-DD"
            />
          </el-form-item>
        </el-col>
        <el-col :span="4">
          <el-row class="btnSection">
            <el-button type="success">签字</el-button>
            <el-button type="danger">驳回</el-button>
          </el-row>
        </el-col>
        <el-col :span="6">
          <el-form-item label="转办人：" prop="zanding">
            <el-select v-model="form.zanding">
              <el-option
                v-for="item in dbUserList"
                :key="item.userId"
                :value="item.userId"
                :label="item.userName"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="2">
          <el-button type="success">转办</el-button>
        </el-col>
      </el-row>

      <p class="pinformation">商务评审</p>
      <el-row>
        <el-col :span="10">
          <el-form-item
            label="各户要求与协议、合同内容是否一致："
            label-width="340px"
            prop="isCustomSame"
          >
            <el-radio-group v-model="form.isCustomSame">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="2">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="14">
          <el-form-item label="详细说明：" prop="customContent">
            <el-input clearable v-model="form.customContent"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="10">
          <el-form-item
            label="收费与工作量是否匹配："
            label-width="340px"
            prop="isCharge"
          >
            <el-radio-group v-model="form.isCharge">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="2">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="14">
          <el-form-item label="详细说明：" prop="chargeContent">
            <el-input clearable v-model="form.chargeContent"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="10">
          <el-form-item
            label="付款比例是否合适："
            label-width="340px"
            prop="isScale"
          >
            <el-radio-group v-model="form.isScale">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="2">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="14">
          <el-form-item label="详细说明：" prop="scaleContent">
            <el-input clearable v-model="form.scaleContent"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-form-item
          label="合同内客是否与常规要求有明显候差，有无明显不利于我方的条款："
          prop="isContract"
        >
          <el-radio-group v-model="form.isContract">
            <el-radio :label="1">有</el-radio>
            <el-radio :label="2">无</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-row>
      <el-form-item label="其他：" prop="otherContent">
        <el-input clearable v-model="form.otherContent"></el-input>
      </el-form-item>
      <el-row>
        <el-col :span="8">
          <el-form-item label="评审人（技术负责人）：" label-width="300px">
            <el-input clearable v-model="form.zanding"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="4">
          <el-form-item label="日期：" label-width="80px">
            <el-date-picker
              v-model="form.zanding"
              placeholder="请选择日期"
              style="width: 97%"
              type="date"
              value-format="YYYY-MM-DD"
            />
          </el-form-item>
        </el-col>
        <el-col :span="4">
          <el-row class="btnSection">
            <el-button type="success">签字</el-button>
            <el-button type="danger">驳回</el-button>
          </el-row>
        </el-col>
        <el-col :span="6">
          <el-form-item label="转办人：">
            <el-select v-model="form.zanding">
              <el-option
                v-for="item in dbUserList"
                :key="item.userId"
                :value="item.userId"
                :label="item.userName"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="2">
          <el-button type="success">转办</el-button>
        </el-col>
      </el-row>
      <p class="pinformation">分管副总审批意见</p>
      <!-- <el-row :gutter="10">
        <el-col :span="9">
          <el-form-item label="分管副总：">
            <el-input  clearabletype="textarea" :rows="3" resize="none"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="15">
          <el-row :gutter="10">
            <el-col :span="8">
              <el-form-item label="分管副总：" label-width="80px">
                <el-input></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="日期：">
                <el-input></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-button type="success">签字</el-button>
              <el-button type="danger">驳回</el-button>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="8">
              <el-form-item label="转办人：" label-width="80px">
                  <el-select v-model="form.zanding">
                    <el-option></el-option>
                  </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-button type="success">转办</el-button>
            </el-col>
          </el-row>
        </el-col>
      </el-row>-->
    </el-form>
  </div>
</template>

<script setup>
import { updateReview } from "@/api/contract/review";
import { getReview } from "@/api/contract/review";

const { proxy } = getCurrentInstance();

const data = reactive({
  form: {
    isWt: 1,
    isWtf: 1,
    isJfyq: 1,
    isPackage: 2,
    isAccept: 1,
    isReport: 1,
    isCustomSame: 1,
    isCharge: 1,
    isScale: 1,
  },
});

const { form } = toRefs(data);

const yqList = [
  { value: 1, label: "是" },
  { value: 0, label: "否" },
];

const dbUserList = ref([
  {
    userId: 1,
    userName: "是",
  },
]);

const props = defineProps({
  echo: {
    type: String,
  },
});
function echo() {
  nextTick(function () {
    getReview(props.echo).then((res) => {
      if (res.data) {
        form.value = res.data;
      } else {
        proxy.resetForm("formRef");
        form.value.contractId = props.echo;
      }
    });
  });
}
function handeleSave() {
  if (props.echo) {
    updateReview(form.value).then((res) => {
      proxy.$modal.msgSuccess(res.msg);
    });
  } else {
    proxy.$modal.msgError('请先选择左侧待评审列表')
  }
}
defineExpose({
  echo,
});
</script>

<style scoped></style>
